<%@ page import="cn.school.entity.Student" %>
<%@ page import="cn.school.service.StudentService" %><%--
  Created by IntelliJ IDEA.
  User: ghost
  Date: 2019/12/9
  Time: 15:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%@include file="checkLogin.jsp"%>
<%
    String url = request.getHeader("Referer");
    if(url==null||!url.equals("http://localhost:8080/12_6/studentinfo.jsp")){
        out.print("<script>alert('禁止翻墙！！！');" +
                "window.history.back(-1);</script>");
        return;
    }
%>
<%
    int id = Integer.parseInt(request.getParameter("id"));
    StudentService ss = new StudentService();
    int flag = ss.delstu(id);
    if(flag == 1){
        out.print("<script>alert('删除成功！！！');" +
                "window.location.href='studentinfo.jsp';</script>");
    }else{
        out.print("<script>alert('删除失败！！！');" +
                "window.location.href='studentinfo.jsp';</script>");
    }
%>
<%=id%>
</body>
</html>
